using UnityEngine;
using System.Collections;

public class ImpactoBalaPlayer : MonoBehaviour {

    public float tiempo; 

	void Start () 
    { 
		Destroy(this.gameObject, tiempo);
	}
	
    void OnTriggerEnter(Collider other)
    {
        if (other.name == "Vampiro(Clone)")
        {
			VampiroControl vc = other.GetComponent("VampiroControl") as VampiroControl;
            vc.RecibirDmg(damage); 	
			Destroy(this.gameObject);	           
        }
        else if (other.name == "Zombie")
        {
            ZombieControl zc = other.GetComponent("ZombieControl") as ZombieControl;
            zc.RecibirDmg(damage);
            Destroy(this.gameObject);
        }
        
		
    }

    public float damage { get; set; }


}
